<!--<template>-->
<!--  <div>-->
<!--    &lt;!&ndash; 子组件输入框 &ndash;&gt;-->
<!--    &lt;!&ndash; 通过 v-on:input绑定输入触发的方法input_src，$event.target.value传递输入的值&ndash;&gt;-->
<!--    <input type="text " v-on:input="ok($event.target.value)" />-->
<!--  </div>-->
<!--</template>-->
<template>
  <a-modal :title="this.title" :visible="this.visible" @cancel="cancel" @ok="ok">
    <a-form :form="form" layout="horizontal">
      <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="原因">
        <input v-model="mes" placeholder="请输入"/>
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
import aModal from '@/common/modal';
import {NEEDACCEPT} from '@/../static/js/apis.js'
export default {
  inject:['reload'],                                 //注入App里的reload方法
  name: 'reaModal',
  props: ['title', 'visible','record'],
  components: {
    aModal
  },
  data() {
    return {
      form: this.$form.createForm(this),
      labelCol: { span: 5 },
      wrapperCol: { span: 18 },
      mes:''
    };

  },
  methods: {
    /*  this.$emit("input", e);给父组件传值 */
    ok(e) {
      let self = this
      console.log(self.record)
      self.record.reason=self.mes
      console.log(self.record.reason)
      console.log(self.record.reason)
      NEEDACCEPT(self.record, function (res) {
        self.$message.success(res.message)
        self.reload()
        })
    },
    cancel (e) {
      this.form.resetFields()
      this.$emit('cancel', e)
    }
  },
};
</script>
